package com.woniuxueyuan.entity.dto;


import com.woniuxueyuan.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDTO {
    private Integer id;
    private String account;
    private String nickName; //别名

    public UserDTO(User user){
        //把PO属性赋值给DTO
        //参数1：po  参数2：DTO
        BeanUtils.copyProperties(user,this);
    }
}
